﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using Microformats.Controls;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing.Design;
using System.Web.UI;

namespace Microformats.Controls
{
    public class MessagingCollection : CardProperty
    {
        public MessagingCollection()
        {
            Messaging = new Collection<Messaging>();
        }

        [Browsable(true)]
        [Editor(typeof(CollectionEditor), typeof(UITypeEditor))]
        [Category("Behavior")]
        [Description("Messaging properties")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        public Collection<Messaging> Messaging
        {
            get;
            set;
        }

        public void Render(ref HtmlTextWriter writer)
        {
            writer.RenderBeginTag(HtmlTag);

            foreach (Messaging message in this.Messaging)
            {
                message.Render(ref writer);
            }

            writer.RenderEndTag();
        }
    }
}
